Trouble getting attribute value from object

I'm sure I've done this before, but I'm getting an error now when I try to check the value of an object's attribute, I am getting an error with my code:

currMod = read(modName)
for o in currMod do {
    for attribName is skAttrs do {
        if (o.attribName "" != "") {
            find(skAttrs, attribName, numAttr);
            delete(skAttrs, attribName);
            numAttr++;
            put(skAttrs, attribName, numAttr);
        }
    }
}

The error I'm getting is on line 3 of this block of code.  The error says "null string parameter was passed into argument position 2".  Above this for-loop, I have another for-loop that sets up the skAttrs skip list for all the attributes:

for ad in currMod do {
    if (!ad.system) {
        attribName = ad.name"";
        put(skAttrs, attribName, 0);
    }
}

This error isn't making any sense to me.  Please help this intermediate DXL coder.

 

Chris


Christopher Cote - Fri May 24 10:18:12 EDT 2019

Re: Trouble getting attribute value from object
llandale - Fri May 24 14:02:45 EDT 2019

the "for variable in SKIP" loop returns the DATA of the Skip, not the "KEY".  In this case you are "put"ting a type "int" (the zero) but retrieving a type "string".

Here is the standatrd Skip loop:

int Data

for Data in skpAttrs do

{  attribName = (string key skpAttrs)

   use attribName

}

 

Also, I don't think it wise to delete from the Skip while in the Skip.  You could just replace it with "put(skiAttrs, attribName, numAttr, true)".

-Louie